package cn.schoolwow.util.test.module.beanCopy.testcase;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.util.domain.beanCopy.BeanCopy;
import cn.schoolwow.util.test.module.beanCopy.domain.UserExtend;
import cn.schoolwow.util.test.module.common.domain.User;
import org.junit.Assert;

public class CloneObjectTestCaseFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        User user = new User();
        user.username = "zhangsan";
        user.password = "123456";

        UserExtend userExtend = BeanCopy.cloneObject(user, UserExtend.class);
        Assert.assertEquals(userExtend.username, user.username);
        Assert.assertEquals(userExtend.password, user.password);
    }

    @Override
    public String name() {
        return "Bean克隆实例测试用例";
    }
}
